////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//                                                                                                                            //
//                                                         WNProject                                                          //
//                                                                                                                            //
//            This file is distributed under the BSD 2-Clause open source license. See License.txt for details.               //
//                                                                                                                            //
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef __WN_MATH_BOUNDS_2_H__
#define __WN_MATH_BOUNDS_2_H__

#include "WNCore/inc/WNTypes.h"
#include "WNMath/inc/WNPoint2.h"

namespace WNMath {
    class WNRectangle;
    class WNCircle;
    class WNVector2;

    class WNBounds2 {
    public:
        WNBounds2();
        explicit WNBounds2(const WN_FLOAT32* _f);
        explicit WNBounds2(const WNPoint2& _point);
        explicit WNBounds2(const WNPoint2& _min, const WNPoint2& _max);

        WN_BOOL operator == (const WNBounds2& _bounds) const;
        WN_BOOL operator != (const WNBounds2& _bounds) const;

        WN_VOID Zero();
        WN_VOID Expand(WN_FLOAT32 _amount);
        WN_BOOL Expand(const WNPoint2& _point);
        WN_BOOL Expand(const WNRectangle& _rectangle);
        WN_BOOL Expand(const WNCircle& _circle);
        WN_BOOL Expand(const WNBounds2& _bounds);
        WN_VOID Translate(const WNVector2& _vector);

        WN_FLOAT32 Length() const;
        WN_FLOAT32 Width() const;
        WN_FLOAT32 Perimeter() const;
        WN_FLOAT32 Radius() const;
        WN_FLOAT32 Area() const;

        WN_BOOL IsZero() const;
        WN_BOOL IsInsideOut() const;

        WNBounds2 GetExpanded(WN_FLOAT32 _amount) const;
        WNBounds2 GetExpanded(const WNPoint2& _point) const;
        WNBounds2 GetExpanded(const WNRectangle& _rectangle) const;
        WNBounds2 GetExpanded(const WNCircle& _circle) const;
        WNBounds2 GetExpanded(const WNBounds2& _bounds) const;
        WNBounds2 GetTranslated(const WNVector2& _vector) const;
        WN_VOID GetPoints(WNPoint2* _points) const;

        WNRectangle ToRectangle() const;

    public:
        WNPoint2 mMinimum;
        WNPoint2 mMaximum;
    };
}

#endif // __WN_MATH_BOUNDS_3_H__